home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / plain / contrib / longtocline.tex < prev    next >
Encoding:
Text File  |  1992-08-26  |  1.2 KB  |  27 lines

  1. %%%------------- tear neatly -------------------------------------%%%%
  2. \def\leaderfill{\kern0.5em\leaders\hbox to 0.5em{\hss.\hss}\hfill\kern
  3. 0.5em}% right out of the 'bible'
  4. \newcount\nmbroflines \newbox\scratch \newbox\rule \newdimen\myindent
  5. %caution! \myindent needs to be set first, say e.g.
  6. \myindent=1.5true cm
  7. \def\hugeheader#1#2#3{\bgroup\parskip=0pt
  8. \setbox\scratch=\vbox{{\advance\hsize by-\myindent
  9. \advance\hsize by-3true cm\noindent#2\par}% to prevent blanks
  10. \global\nmbroflines=\prevgraf}%             'you never know'
  11. \unvbox\scratch \setbox\rule=\lastbox
  12. \loop\ifnum\nmbroflines>1
  13. \unskip\unpenalty\setbox\scratch=\lastbox
  14. \advance\nmbroflines by-1\repeat
  15. \setbox\scratch=\hbox{\unhbox\rule\unskip\unskip\unpenalty}%
  16. {\par\advance\hsize by-3true cm\hangindent\myindent
  17. \noindent\hbox to\myindent{#1\hss}#2\par}%
  18. \vskip-\baselineskip
  19. \line{\kern\myindent\kern\wd\scratch\leaderfill#3}\egroup}
  20. \endinput
  21. % usage:
  22. \line{\hbox to\myindent{1.0\hfil}Normal Heading\leaderfill 66}
  23. \hugeheader{1.1}{Abnormal heading of a chapter about giant holes all
  24. over Australia caused by elephants interbreeded with local kangaroos}%
  25. {77}
  26. %%%------------- cut along this line ----------------------------%%%%%
  27.